



// This code is a generated code by a tool
// designed and coded by Shohdi Mohamed Elsheemy ( shohdi@gmail.com )            

using System;
using System.Collections.Generic;
using System.Web;
using System.Data.Common;
using Shohdi.DataHandler;
using System.Data;




namespace DatabaseComponent
{
    
    public partial class HelpDescContactsDB
    {
         string _Connection = "";


        public string Connection
        {
            get { return _Connection; }
            set { _Connection = value; }
        }


       
         string _Provider = "System.Data.SqlClient";

        
        public string Provider
        {
            get { return _Provider; }
            set { _Provider = value; }
        }



        public HelpDescContactsDB()
        {
        }

        public HelpDescContactsDB(string __Connection,params string [] __Provider)
        {

            if (__Provider.Length > 0)
                _Provider = __Provider[0];

            _Connection = __Connection;
            
        }




        public List<HelpDescContacts> Select(ClassDataHandler con, string strTop, string strWhere, params DbParameter[] whereParams)
        {
            if (whereParams == null)
                whereParams = new DbParameter[0];

            List<HelpDescContacts> lstRet = new List<HelpDescContacts>();

            string strQuery = " select " + strTop  + " * from dbo.[HelpDescContacts]  " ;

            if (strWhere != "")
            {
                strQuery = strQuery + "  " + strWhere;
            }

            DbDataReader dr = con.SelectDataReader(strQuery, CommandType.Text, whereParams);


            if (dr.HasRows)
            {
                while (dr.Read())
                {
                    HelpDescContacts obj = new HelpDescContacts();
 if (dr["ID"] != DBNull.Value)
                    {
                        obj.ID = (System.Int64)dr["ID"];
                    }
                    else
                    {
                        obj.ID = -1;
                    } 
 if (dr["NameAR"] != DBNull.Value)
                    {
                        obj.NameAR = (System.String)dr["NameAR"];
                    }
                    else
                    {
                        obj.NameAR = "";
                    } 
 if (dr["NameEN"] != DBNull.Value)
                    {
                        obj.NameEN = (System.String)dr["NameEN"];
                    }
                    else
                    {
                        obj.NameEN = "";
                    } 
 if (dr["MiddleNameAR"] != DBNull.Value)
                    {
                        obj.MiddleNameAR = (System.String)dr["MiddleNameAR"];
                    }
                    else
                    {
                        obj.MiddleNameAR = "";
                    } 
 if (dr["MiddleNameEN"] != DBNull.Value)
                    {
                        obj.MiddleNameEN = (System.String)dr["MiddleNameEN"];
                    }
                    else
                    {
                        obj.MiddleNameEN = "";
                    } 
 if (dr["LastNameAR"] != DBNull.Value)
                    {
                        obj.LastNameAR = (System.String)dr["LastNameAR"];
                    }
                    else
                    {
                        obj.LastNameAR = "";
                    } 
 if (dr["LastNameEN"] != DBNull.Value)
                    {
                        obj.LastNameEN = (System.String)dr["LastNameEN"];
                    }
                    else
                    {
                        obj.LastNameEN = "";
                    } 
 if (dr["Phone1"] != DBNull.Value)
                    {
                        obj.Phone1 = (System.String)dr["Phone1"];
                    }
                    else
                    {
                        obj.Phone1 = "";
                    } 
 if (dr["Inner1"] != DBNull.Value)
                    {
                        obj.Inner1 = (System.String)dr["Inner1"];
                    }
                    else
                    {
                        obj.Inner1 = "";
                    } 
 if (dr["Phone2"] != DBNull.Value)
                    {
                        obj.Phone2 = (System.String)dr["Phone2"];
                    }
                    else
                    {
                        obj.Phone2 = "";
                    } 
 if (dr["Inner2"] != DBNull.Value)
                    {
                        obj.Inner2 = (System.String)dr["Inner2"];
                    }
                    else
                    {
                        obj.Inner2 = "";
                    } 
 if (dr["Mobile1"] != DBNull.Value)
                    {
                        obj.Mobile1 = (System.String)dr["Mobile1"];
                    }
                    else
                    {
                        obj.Mobile1 = "";
                    } 
 if (dr["Mobile2"] != DBNull.Value)
                    {
                        obj.Mobile2 = (System.String)dr["Mobile2"];
                    }
                    else
                    {
                        obj.Mobile2 = "";
                    } 
 if (dr["Email"] != DBNull.Value)
                    {
                        obj.Email = (System.String)dr["Email"];
                    }
                    else
                    {
                        obj.Email = "";
                    } 
 if (dr["AreaID"] != DBNull.Value)
                    {
                        obj.AreaID = (System.Int64)dr["AreaID"];
                    }
                    else
                    {
                        obj.AreaID = -1;
                    } 



                    lstRet.Add(obj);
                   

                }
            }

            dr.Close();


            return lstRet;
        }


        public List<HelpDescContacts> Select(string strTop, string strWhere, params DbParameter[] whereParams)
        {
            ClassDataHandler con = new ClassDataHandler(_Connection, _Provider);

            con.OpenConnection();

            List<HelpDescContacts> lstRet = Select(con, strTop, strWhere, whereParams);

            con.CloseConnection();

            return lstRet;
        }

        



        public void Insert(ClassDataHandler con , HelpDescContacts obj)
        {
            
            

                    DbParameter prmNameAR = con.createParameter();
                    prmNameAR.ParameterName = "@NameAR";
                    prmNameAR.DbType =DbType.String;
                    if (obj.NameAR == null)
                    {
                        prmNameAR.Value = DBNull.Value;
                    }
                    else
                    {
                        prmNameAR.Value = obj.NameAR;
                    }
                

                    


                    DbParameter prmNameEN = con.createParameter();
                    prmNameEN.ParameterName = "@NameEN";
                    prmNameEN.DbType =DbType.String;
                    if (obj.NameEN == null)
                    {
                        prmNameEN.Value = DBNull.Value;
                    }
                    else
                    {
                        prmNameEN.Value = obj.NameEN;
                    }
                

                    


                    DbParameter prmMiddleNameAR = con.createParameter();
                    prmMiddleNameAR.ParameterName = "@MiddleNameAR";
                    prmMiddleNameAR.DbType =DbType.String;
                    if (obj.MiddleNameAR == null)
                    {
                        prmMiddleNameAR.Value = DBNull.Value;
                    }
                    else
                    {
                        prmMiddleNameAR.Value = obj.MiddleNameAR;
                    }
                

                    


                    DbParameter prmMiddleNameEN = con.createParameter();
                    prmMiddleNameEN.ParameterName = "@MiddleNameEN";
                    prmMiddleNameEN.DbType =DbType.String;
                    if (obj.MiddleNameEN == null)
                    {
                        prmMiddleNameEN.Value = DBNull.Value;
                    }
                    else
                    {
                        prmMiddleNameEN.Value = obj.MiddleNameEN;
                    }
                

                    


                    DbParameter prmLastNameAR = con.createParameter();
                    prmLastNameAR.ParameterName = "@LastNameAR";
                    prmLastNameAR.DbType =DbType.String;
                    if (obj.LastNameAR == null)
                    {
                        prmLastNameAR.Value = DBNull.Value;
                    }
                    else
                    {
                        prmLastNameAR.Value = obj.LastNameAR;
                    }
                

                    


                    DbParameter prmLastNameEN = con.createParameter();
                    prmLastNameEN.ParameterName = "@LastNameEN";
                    prmLastNameEN.DbType =DbType.String;
                    if (obj.LastNameEN == null)
                    {
                        prmLastNameEN.Value = DBNull.Value;
                    }
                    else
                    {
                        prmLastNameEN.Value = obj.LastNameEN;
                    }
                

                    


                    DbParameter prmPhone1 = con.createParameter();
                    prmPhone1.ParameterName = "@Phone1";
                    prmPhone1.DbType =DbType.String;
                    if (obj.Phone1 == null)
                    {
                        prmPhone1.Value = DBNull.Value;
                    }
                    else
                    {
                        prmPhone1.Value = obj.Phone1;
                    }
                

                    


                    DbParameter prmInner1 = con.createParameter();
                    prmInner1.ParameterName = "@Inner1";
                    prmInner1.DbType =DbType.String;
                    if (obj.Inner1 == null)
                    {
                        prmInner1.Value = DBNull.Value;
                    }
                    else
                    {
                        prmInner1.Value = obj.Inner1;
                    }
                

                    


                    DbParameter prmPhone2 = con.createParameter();
                    prmPhone2.ParameterName = "@Phone2";
                    prmPhone2.DbType =DbType.String;
                    if (obj.Phone2 == null)
                    {
                        prmPhone2.Value = DBNull.Value;
                    }
                    else
                    {
                        prmPhone2.Value = obj.Phone2;
                    }
                

                    


                    DbParameter prmInner2 = con.createParameter();
                    prmInner2.ParameterName = "@Inner2";
                    prmInner2.DbType =DbType.String;
                    if (obj.Inner2 == null)
                    {
                        prmInner2.Value = DBNull.Value;
                    }
                    else
                    {
                        prmInner2.Value = obj.Inner2;
                    }
                

                    


                    DbParameter prmMobile1 = con.createParameter();
                    prmMobile1.ParameterName = "@Mobile1";
                    prmMobile1.DbType =DbType.String;
                    if (obj.Mobile1 == null)
                    {
                        prmMobile1.Value = DBNull.Value;
                    }
                    else
                    {
                        prmMobile1.Value = obj.Mobile1;
                    }
                

                    


                    DbParameter prmMobile2 = con.createParameter();
                    prmMobile2.ParameterName = "@Mobile2";
                    prmMobile2.DbType =DbType.String;
                    if (obj.Mobile2 == null)
                    {
                        prmMobile2.Value = DBNull.Value;
                    }
                    else
                    {
                        prmMobile2.Value = obj.Mobile2;
                    }
                

                    


                    DbParameter prmEmail = con.createParameter();
                    prmEmail.ParameterName = "@Email";
                    prmEmail.DbType =DbType.String;
                    if (obj.Email == null)
                    {
                        prmEmail.Value = DBNull.Value;
                    }
                    else
                    {
                        prmEmail.Value = obj.Email;
                    }
                

                    


                    DbParameter prmAreaID = con.createParameter();
                    prmAreaID.ParameterName = "@AreaID";
                    prmAreaID.DbType =DbType.Int64;
                    if (obj.AreaID == null)
                    {
                        prmAreaID.Value = DBNull.Value;
                    }
                    else
                    {
                        prmAreaID.Value = obj.AreaID;
                    }
                

                    


           



            string strQuery = " insert into dbo.[HelpDescContacts] ([NameAR],[NameEN],[MiddleNameAR],[MiddleNameEN],[LastNameAR],[LastNameEN],[Phone1],[Inner1],[Phone2],[Inner2],[Mobile1],[Mobile2],[Email],[AreaID]) VALUES (@NameAR,@NameEN,@MiddleNameAR,@MiddleNameEN,@LastNameAR,@LastNameEN,@Phone1,@Inner1,@Phone2,@Inner2,@Mobile1,@Mobile2,@Email,@AreaID) ; select SCOPE_IDENTITY() ";
 object scope = con.ExecuteScalar(strQuery, CommandType.Text, prmNameAR,prmNameEN,prmMiddleNameAR,prmMiddleNameEN,prmLastNameAR,prmLastNameEN,prmPhone1,prmInner1,prmPhone2,prmInner2,prmMobile1,prmMobile2,prmEmail,prmAreaID);


                    try
                    {
                        obj.ID = System.Int64.Parse(scope.ToString());
                    }
                    catch
                    {
                        obj.ID = -1;
                    }


                    


           

        }



        public void Insert(HelpDescContacts obj)
        {
            ClassDataHandler con = new ClassDataHandler(_Connection, _Provider);
            con.OpenConnection();

            Insert(con,obj);


            con.CloseConnection();
        }




        public void Update(ClassDataHandler con, HelpDescContacts obj)
        {
            
            

                    DbParameter prmID = con.createParameter();
                    prmID.ParameterName = "@ID";
                    prmID.DbType =DbType.Int64;
                    if (obj.ID == null)
                    {
                        prmID.Value = DBNull.Value;
                    }
                    else
                    {
                        prmID.Value = obj.ID;
                    }
                

                    


                    DbParameter prmNameAR = con.createParameter();
                    prmNameAR.ParameterName = "@NameAR";
                    prmNameAR.DbType =DbType.String;
                    if (obj.NameAR == null)
                    {
                        prmNameAR.Value = DBNull.Value;
                    }
                    else
                    {
                        prmNameAR.Value = obj.NameAR;
                    }
                

                    


                    DbParameter prmNameEN = con.createParameter();
                    prmNameEN.ParameterName = "@NameEN";
                    prmNameEN.DbType =DbType.String;
                    if (obj.NameEN == null)
                    {
                        prmNameEN.Value = DBNull.Value;
                    }
                    else
                    {
                        prmNameEN.Value = obj.NameEN;
                    }
                

                    


                    DbParameter prmMiddleNameAR = con.createParameter();
                    prmMiddleNameAR.ParameterName = "@MiddleNameAR";
                    prmMiddleNameAR.DbType =DbType.String;
                    if (obj.MiddleNameAR == null)
                    {
                        prmMiddleNameAR.Value = DBNull.Value;
                    }
                    else
                    {
                        prmMiddleNameAR.Value = obj.MiddleNameAR;
                    }
                

                    


                    DbParameter prmMiddleNameEN = con.createParameter();
                    prmMiddleNameEN.ParameterName = "@MiddleNameEN";
                    prmMiddleNameEN.DbType =DbType.String;
                    if (obj.MiddleNameEN == null)
                    {
                        prmMiddleNameEN.Value = DBNull.Value;
                    }
                    else
                    {
                        prmMiddleNameEN.Value = obj.MiddleNameEN;
                    }
                

                    


                    DbParameter prmLastNameAR = con.createParameter();
                    prmLastNameAR.ParameterName = "@LastNameAR";
                    prmLastNameAR.DbType =DbType.String;
                    if (obj.LastNameAR == null)
                    {
                        prmLastNameAR.Value = DBNull.Value;
                    }
                    else
                    {
                        prmLastNameAR.Value = obj.LastNameAR;
                    }
                

                    


                    DbParameter prmLastNameEN = con.createParameter();
                    prmLastNameEN.ParameterName = "@LastNameEN";
                    prmLastNameEN.DbType =DbType.String;
                    if (obj.LastNameEN == null)
                    {
                        prmLastNameEN.Value = DBNull.Value;
                    }
                    else
                    {
                        prmLastNameEN.Value = obj.LastNameEN;
                    }
                

                    


                    DbParameter prmPhone1 = con.createParameter();
                    prmPhone1.ParameterName = "@Phone1";
                    prmPhone1.DbType =DbType.String;
                    if (obj.Phone1 == null)
                    {
                        prmPhone1.Value = DBNull.Value;
                    }
                    else
                    {
                        prmPhone1.Value = obj.Phone1;
                    }
                

                    


                    DbParameter prmInner1 = con.createParameter();
                    prmInner1.ParameterName = "@Inner1";
                    prmInner1.DbType =DbType.String;
                    if (obj.Inner1 == null)
                    {
                        prmInner1.Value = DBNull.Value;
                    }
                    else
                    {
                        prmInner1.Value = obj.Inner1;
                    }
                

                    


                    DbParameter prmPhone2 = con.createParameter();
                    prmPhone2.ParameterName = "@Phone2";
                    prmPhone2.DbType =DbType.String;
                    if (obj.Phone2 == null)
                    {
                        prmPhone2.Value = DBNull.Value;
                    }
                    else
                    {
                        prmPhone2.Value = obj.Phone2;
                    }
                

                    


                    DbParameter prmInner2 = con.createParameter();
                    prmInner2.ParameterName = "@Inner2";
                    prmInner2.DbType =DbType.String;
                    if (obj.Inner2 == null)
                    {
                        prmInner2.Value = DBNull.Value;
                    }
                    else
                    {
                        prmInner2.Value = obj.Inner2;
                    }
                

                    


                    DbParameter prmMobile1 = con.createParameter();
                    prmMobile1.ParameterName = "@Mobile1";
                    prmMobile1.DbType =DbType.String;
                    if (obj.Mobile1 == null)
                    {
                        prmMobile1.Value = DBNull.Value;
                    }
                    else
                    {
                        prmMobile1.Value = obj.Mobile1;
                    }
                

                    


                    DbParameter prmMobile2 = con.createParameter();
                    prmMobile2.ParameterName = "@Mobile2";
                    prmMobile2.DbType =DbType.String;
                    if (obj.Mobile2 == null)
                    {
                        prmMobile2.Value = DBNull.Value;
                    }
                    else
                    {
                        prmMobile2.Value = obj.Mobile2;
                    }
                

                    


                    DbParameter prmEmail = con.createParameter();
                    prmEmail.ParameterName = "@Email";
                    prmEmail.DbType =DbType.String;
                    if (obj.Email == null)
                    {
                        prmEmail.Value = DBNull.Value;
                    }
                    else
                    {
                        prmEmail.Value = obj.Email;
                    }
                

                    


                    DbParameter prmAreaID = con.createParameter();
                    prmAreaID.ParameterName = "@AreaID";
                    prmAreaID.DbType =DbType.Int64;
                    if (obj.AreaID == null)
                    {
                        prmAreaID.Value = DBNull.Value;
                    }
                    else
                    {
                        prmAreaID.Value = obj.AreaID;
                    }
                

                    


           



            string strQuery = " update dbo.[HelpDescContacts] set [NameAR]=@NameAR,[NameEN]=@NameEN,[MiddleNameAR]=@MiddleNameAR,[MiddleNameEN]=@MiddleNameEN,[LastNameAR]=@LastNameAR,[LastNameEN]=@LastNameEN,[Phone1]=@Phone1,[Inner1]=@Inner1,[Phone2]=@Phone2,[Inner2]=@Inner2,[Mobile1]=@Mobile1,[Mobile2]=@Mobile2,[Email]=@Email,[AreaID]=@AreaID where  [ID]=@ID  ";

            con.ExecuteNonQuery(strQuery, CommandType.Text,prmID,prmNameAR,prmNameEN,prmMiddleNameAR,prmMiddleNameEN,prmLastNameAR,prmLastNameEN,prmPhone1,prmInner1,prmPhone2,prmInner2,prmMobile1,prmMobile2,prmEmail,prmAreaID);

            

        }


        public void Update(HelpDescContacts obj)
        {
            ClassDataHandler con = new ClassDataHandler(_Connection, _Provider);
            con.OpenConnection();

            Update(con, obj);


            con.CloseConnection();
        }



        public void Delete(ClassDataHandler con, HelpDescContacts obj)
        {

            

                    DbParameter prmID = con.createParameter();
                    prmID.ParameterName = "@ID";
                    prmID.DbType =DbType.Int64;
                    if (obj.ID == null)
                    {
                        prmID.Value = DBNull.Value;
                    }
                    else
                    {
                        prmID.Value = obj.ID;
                    }
                

                    


           



           



            string strQuery = " delete from dbo.[HelpDescContacts]  where  [ID]=@ID  "; 
                        con.ExecuteNonQuery(strQuery, CommandType.Text,prmID );  

             



        }


        public void Delete( HelpDescContacts obj)
        {
            ClassDataHandler con = new ClassDataHandler(_Connection, _Provider);

            con.OpenConnection();

            Delete(con, obj);

            con.CloseConnection();
        }





                    public List<HelpDescContacts> getHelpDescContactsByID(ClassDataHandler con,System.Int64 ID)
                    {
                        List<HelpDescContacts> lstRet = new List<HelpDescContacts>();


                        DbParameter prmID = con.createParameter();
                        prmID.ParameterName = "@ID";
                        prmID.DbType = DbType.Int64;
                        if (ID == null)
                        {
                            return lstRet;
                        }
                        else
                        {
                            prmID.Value = ID;
                        }


                        lstRet = Select(con, "" , " where [ID]=@ID ", prmID);



                        return lstRet;

                    }


                    public List<HelpDescContacts> getHelpDescContactsByID(System.Int64 ID)
                    {
                        List<HelpDescContacts> lstRet = new List<HelpDescContacts>();

                        ClassDataHandler con = new ClassDataHandler(_Connection, _Provider);
                        con.OpenConnection();

                        lstRet = getHelpDescContactsByID(con, ID);

                        con.CloseConnection();

                        return lstRet;

                    }



                

                    public List<HelpDescContacts> getHelpDescContactsByNameAR(ClassDataHandler con,System.String NameAR)
                    {
                        List<HelpDescContacts> lstRet = new List<HelpDescContacts>();


                        DbParameter prmNameAR = con.createParameter();
                        prmNameAR.ParameterName = "@NameAR";
                        prmNameAR.DbType = DbType.String;
                        if (NameAR == null)
                        {
                            return lstRet;
                        }
                        else
                        {
                            prmNameAR.Value = NameAR;
                        }


                        lstRet = Select(con, "" , " where [NameAR]=@NameAR ", prmNameAR);



                        return lstRet;

                    }


                    public List<HelpDescContacts> getHelpDescContactsByNameAR(System.String NameAR)
                    {
                        List<HelpDescContacts> lstRet = new List<HelpDescContacts>();

                        ClassDataHandler con = new ClassDataHandler(_Connection, _Provider);
                        con.OpenConnection();

                        lstRet = getHelpDescContactsByNameAR(con, NameAR);

                        con.CloseConnection();

                        return lstRet;

                    }



                

                    public List<HelpDescContacts> getHelpDescContactsByNameEN(ClassDataHandler con,System.String NameEN)
                    {
                        List<HelpDescContacts> lstRet = new List<HelpDescContacts>();


                        DbParameter prmNameEN = con.createParameter();
                        prmNameEN.ParameterName = "@NameEN";
                        prmNameEN.DbType = DbType.String;
                        if (NameEN == null)
                        {
                            return lstRet;
                        }
                        else
                        {
                            prmNameEN.Value = NameEN;
                        }


                        lstRet = Select(con, "" , " where [NameEN]=@NameEN ", prmNameEN);



                        return lstRet;

                    }


                    public List<HelpDescContacts> getHelpDescContactsByNameEN(System.String NameEN)
                    {
                        List<HelpDescContacts> lstRet = new List<HelpDescContacts>();

                        ClassDataHandler con = new ClassDataHandler(_Connection, _Provider);
                        con.OpenConnection();

                        lstRet = getHelpDescContactsByNameEN(con, NameEN);

                        con.CloseConnection();

                        return lstRet;

                    }



                

                    public List<HelpDescContacts> getHelpDescContactsByMiddleNameAR(ClassDataHandler con,System.String MiddleNameAR)
                    {
                        List<HelpDescContacts> lstRet = new List<HelpDescContacts>();


                        DbParameter prmMiddleNameAR = con.createParameter();
                        prmMiddleNameAR.ParameterName = "@MiddleNameAR";
                        prmMiddleNameAR.DbType = DbType.String;
                        if (MiddleNameAR == null)
                        {
                            return lstRet;
                        }
                        else
                        {
                            prmMiddleNameAR.Value = MiddleNameAR;
                        }


                        lstRet = Select(con, "" , " where [MiddleNameAR]=@MiddleNameAR ", prmMiddleNameAR);



                        return lstRet;

                    }


                    public List<HelpDescContacts> getHelpDescContactsByMiddleNameAR(System.String MiddleNameAR)
                    {
                        List<HelpDescContacts> lstRet = new List<HelpDescContacts>();

                        ClassDataHandler con = new ClassDataHandler(_Connection, _Provider);
                        con.OpenConnection();

                        lstRet = getHelpDescContactsByMiddleNameAR(con, MiddleNameAR);

                        con.CloseConnection();

                        return lstRet;

                    }



                

                    public List<HelpDescContacts> getHelpDescContactsByMiddleNameEN(ClassDataHandler con,System.String MiddleNameEN)
                    {
                        List<HelpDescContacts> lstRet = new List<HelpDescContacts>();


                        DbParameter prmMiddleNameEN = con.createParameter();
                        prmMiddleNameEN.ParameterName = "@MiddleNameEN";
                        prmMiddleNameEN.DbType = DbType.String;
                        if (MiddleNameEN == null)
                        {
                            return lstRet;
                        }
                        else
                        {
                            prmMiddleNameEN.Value = MiddleNameEN;
                        }


                        lstRet = Select(con, "" , " where [MiddleNameEN]=@MiddleNameEN ", prmMiddleNameEN);



                        return lstRet;

                    }


                    public List<HelpDescContacts> getHelpDescContactsByMiddleNameEN(System.String MiddleNameEN)
                    {
                        List<HelpDescContacts> lstRet = new List<HelpDescContacts>();

                        ClassDataHandler con = new ClassDataHandler(_Connection, _Provider);
                        con.OpenConnection();

                        lstRet = getHelpDescContactsByMiddleNameEN(con, MiddleNameEN);

                        con.CloseConnection();

                        return lstRet;

                    }



                

                    public List<HelpDescContacts> getHelpDescContactsByLastNameAR(ClassDataHandler con,System.String LastNameAR)
                    {
                        List<HelpDescContacts> lstRet = new List<HelpDescContacts>();


                        DbParameter prmLastNameAR = con.createParameter();
                        prmLastNameAR.ParameterName = "@LastNameAR";
                        prmLastNameAR.DbType = DbType.String;
                        if (LastNameAR == null)
                        {
                            return lstRet;
                        }
                        else
                        {
                            prmLastNameAR.Value = LastNameAR;
                        }


                        lstRet = Select(con, "" , " where [LastNameAR]=@LastNameAR ", prmLastNameAR);



                        return lstRet;

                    }


                    public List<HelpDescContacts> getHelpDescContactsByLastNameAR(System.String LastNameAR)
                    {
                        List<HelpDescContacts> lstRet = new List<HelpDescContacts>();

                        ClassDataHandler con = new ClassDataHandler(_Connection, _Provider);
                        con.OpenConnection();

                        lstRet = getHelpDescContactsByLastNameAR(con, LastNameAR);

                        con.CloseConnection();

                        return lstRet;

                    }



                

                    public List<HelpDescContacts> getHelpDescContactsByLastNameEN(ClassDataHandler con,System.String LastNameEN)
                    {
                        List<HelpDescContacts> lstRet = new List<HelpDescContacts>();


                        DbParameter prmLastNameEN = con.createParameter();
                        prmLastNameEN.ParameterName = "@LastNameEN";
                        prmLastNameEN.DbType = DbType.String;
                        if (LastNameEN == null)
                        {
                            return lstRet;
                        }
                        else
                        {
                            prmLastNameEN.Value = LastNameEN;
                        }


                        lstRet = Select(con, "" , " where [LastNameEN]=@LastNameEN ", prmLastNameEN);



                        return lstRet;

                    }


                    public List<HelpDescContacts> getHelpDescContactsByLastNameEN(System.String LastNameEN)
                    {
                        List<HelpDescContacts> lstRet = new List<HelpDescContacts>();

                        ClassDataHandler con = new ClassDataHandler(_Connection, _Provider);
                        con.OpenConnection();

                        lstRet = getHelpDescContactsByLastNameEN(con, LastNameEN);

                        con.CloseConnection();

                        return lstRet;

                    }



                

                    public List<HelpDescContacts> getHelpDescContactsByPhone1(ClassDataHandler con,System.String Phone1)
                    {
                        List<HelpDescContacts> lstRet = new List<HelpDescContacts>();


                        DbParameter prmPhone1 = con.createParameter();
                        prmPhone1.ParameterName = "@Phone1";
                        prmPhone1.DbType = DbType.String;
                        if (Phone1 == null)
                        {
                            return lstRet;
                        }
                        else
                        {
                            prmPhone1.Value = Phone1;
                        }


                        lstRet = Select(con, "" , " where [Phone1]=@Phone1 ", prmPhone1);



                        return lstRet;

                    }


                    public List<HelpDescContacts> getHelpDescContactsByPhone1(System.String Phone1)
                    {
                        List<HelpDescContacts> lstRet = new List<HelpDescContacts>();

                        ClassDataHandler con = new ClassDataHandler(_Connection, _Provider);
                        con.OpenConnection();

                        lstRet = getHelpDescContactsByPhone1(con, Phone1);

                        con.CloseConnection();

                        return lstRet;

                    }



                

                    public List<HelpDescContacts> getHelpDescContactsByInner1(ClassDataHandler con,System.String Inner1)
                    {
                        List<HelpDescContacts> lstRet = new List<HelpDescContacts>();


                        DbParameter prmInner1 = con.createParameter();
                        prmInner1.ParameterName = "@Inner1";
                        prmInner1.DbType = DbType.String;
                        if (Inner1 == null)
                        {
                            return lstRet;
                        }
                        else
                        {
                            prmInner1.Value = Inner1;
                        }


                        lstRet = Select(con, "" , " where [Inner1]=@Inner1 ", prmInner1);



                        return lstRet;

                    }


                    public List<HelpDescContacts> getHelpDescContactsByInner1(System.String Inner1)
                    {
                        List<HelpDescContacts> lstRet = new List<HelpDescContacts>();

                        ClassDataHandler con = new ClassDataHandler(_Connection, _Provider);
                        con.OpenConnection();

                        lstRet = getHelpDescContactsByInner1(con, Inner1);

                        con.CloseConnection();

                        return lstRet;

                    }



                

                    public List<HelpDescContacts> getHelpDescContactsByPhone2(ClassDataHandler con,System.String Phone2)
                    {
                        List<HelpDescContacts> lstRet = new List<HelpDescContacts>();


                        DbParameter prmPhone2 = con.createParameter();
                        prmPhone2.ParameterName = "@Phone2";
                        prmPhone2.DbType = DbType.String;
                        if (Phone2 == null)
                        {
                            return lstRet;
                        }
                        else
                        {
                            prmPhone2.Value = Phone2;
                        }


                        lstRet = Select(con, "" , " where [Phone2]=@Phone2 ", prmPhone2);



                        return lstRet;

                    }


                    public List<HelpDescContacts> getHelpDescContactsByPhone2(System.String Phone2)
                    {
                        List<HelpDescContacts> lstRet = new List<HelpDescContacts>();

                        ClassDataHandler con = new ClassDataHandler(_Connection, _Provider);
                        con.OpenConnection();

                        lstRet = getHelpDescContactsByPhone2(con, Phone2);

                        con.CloseConnection();

                        return lstRet;

                    }



                

                    public List<HelpDescContacts> getHelpDescContactsByInner2(ClassDataHandler con,System.String Inner2)
                    {
                        List<HelpDescContacts> lstRet = new List<HelpDescContacts>();


                        DbParameter prmInner2 = con.createParameter();
                        prmInner2.ParameterName = "@Inner2";
                        prmInner2.DbType = DbType.String;
                        if (Inner2 == null)
                        {
                            return lstRet;
                        }
                        else
                        {
                            prmInner2.Value = Inner2;
                        }


                        lstRet = Select(con, "" , " where [Inner2]=@Inner2 ", prmInner2);



                        return lstRet;

                    }


                    public List<HelpDescContacts> getHelpDescContactsByInner2(System.String Inner2)
                    {
                        List<HelpDescContacts> lstRet = new List<HelpDescContacts>();

                        ClassDataHandler con = new ClassDataHandler(_Connection, _Provider);
                        con.OpenConnection();

                        lstRet = getHelpDescContactsByInner2(con, Inner2);

                        con.CloseConnection();

                        return lstRet;

                    }



                

                    public List<HelpDescContacts> getHelpDescContactsByMobile1(ClassDataHandler con,System.String Mobile1)
                    {
                        List<HelpDescContacts> lstRet = new List<HelpDescContacts>();


                        DbParameter prmMobile1 = con.createParameter();
                        prmMobile1.ParameterName = "@Mobile1";
                        prmMobile1.DbType = DbType.String;
                        if (Mobile1 == null)
                        {
                            return lstRet;
                        }
                        else
                        {
                            prmMobile1.Value = Mobile1;
                        }


                        lstRet = Select(con, "" , " where [Mobile1]=@Mobile1 ", prmMobile1);



                        return lstRet;

                    }


                    public List<HelpDescContacts> getHelpDescContactsByMobile1(System.String Mobile1)
                    {
                        List<HelpDescContacts> lstRet = new List<HelpDescContacts>();

                        ClassDataHandler con = new ClassDataHandler(_Connection, _Provider);
                        con.OpenConnection();

                        lstRet = getHelpDescContactsByMobile1(con, Mobile1);

                        con.CloseConnection();

                        return lstRet;

                    }



                

                    public List<HelpDescContacts> getHelpDescContactsByMobile2(ClassDataHandler con,System.String Mobile2)
                    {
                        List<HelpDescContacts> lstRet = new List<HelpDescContacts>();


                        DbParameter prmMobile2 = con.createParameter();
                        prmMobile2.ParameterName = "@Mobile2";
                        prmMobile2.DbType = DbType.String;
                        if (Mobile2 == null)
                        {
                            return lstRet;
                        }
                        else
                        {
                            prmMobile2.Value = Mobile2;
                        }


                        lstRet = Select(con, "" , " where [Mobile2]=@Mobile2 ", prmMobile2);



                        return lstRet;

                    }


                    public List<HelpDescContacts> getHelpDescContactsByMobile2(System.String Mobile2)
                    {
                        List<HelpDescContacts> lstRet = new List<HelpDescContacts>();

                        ClassDataHandler con = new ClassDataHandler(_Connection, _Provider);
                        con.OpenConnection();

                        lstRet = getHelpDescContactsByMobile2(con, Mobile2);

                        con.CloseConnection();

                        return lstRet;

                    }



                

                    public List<HelpDescContacts> getHelpDescContactsByEmail(ClassDataHandler con,System.String Email)
                    {
                        List<HelpDescContacts> lstRet = new List<HelpDescContacts>();


                        DbParameter prmEmail = con.createParameter();
                        prmEmail.ParameterName = "@Email";
                        prmEmail.DbType = DbType.String;
                        if (Email == null)
                        {
                            return lstRet;
                        }
                        else
                        {
                            prmEmail.Value = Email;
                        }


                        lstRet = Select(con, "" , " where [Email]=@Email ", prmEmail);



                        return lstRet;

                    }


                    public List<HelpDescContacts> getHelpDescContactsByEmail(System.String Email)
                    {
                        List<HelpDescContacts> lstRet = new List<HelpDescContacts>();

                        ClassDataHandler con = new ClassDataHandler(_Connection, _Provider);
                        con.OpenConnection();

                        lstRet = getHelpDescContactsByEmail(con, Email);

                        con.CloseConnection();

                        return lstRet;

                    }



                

                    public List<HelpDescContacts> getHelpDescContactsByAreaID(ClassDataHandler con,System.Int64 AreaID)
                    {
                        List<HelpDescContacts> lstRet = new List<HelpDescContacts>();


                        DbParameter prmAreaID = con.createParameter();
                        prmAreaID.ParameterName = "@AreaID";
                        prmAreaID.DbType = DbType.Int64;
                        if (AreaID == null)
                        {
                            return lstRet;
                        }
                        else
                        {
                            prmAreaID.Value = AreaID;
                        }


                        lstRet = Select(con, "" , " where [AreaID]=@AreaID ", prmAreaID);



                        return lstRet;

                    }


                    public List<HelpDescContacts> getHelpDescContactsByAreaID(System.Int64 AreaID)
                    {
                        List<HelpDescContacts> lstRet = new List<HelpDescContacts>();

                        ClassDataHandler con = new ClassDataHandler(_Connection, _Provider);
                        con.OpenConnection();

                        lstRet = getHelpDescContactsByAreaID(con, AreaID);

                        con.CloseConnection();

                        return lstRet;

                    }



                

            
public List<HelpDescContacts> Search(ClassDataHandler con, HelpDescContacts obj)
        {
            string strWhere = "";
            List<DbParameter> lstParameters = new List<DbParameter>();

            
                    if (obj.ID != -1)
                    {
                        DbParameter prmID = con.createParameter();
                        prmID.ParameterName = "@ID";
                        prmID.DbType =DbType.Int64;
                        if (obj.ID == null)
                        {
                            prmID.Value = DBNull.Value;
                        }
                        else
                        {
                            prmID.Value = obj.ID;
                        }
                        strWhere += " [ID]=@ID AND ";
                        lstParameters.Add(prmID);
                     }



                    

                    if (obj.NameAR != "")
                    {
                        DbParameter prmNameAR = con.createParameter();
                        prmNameAR.ParameterName = "@NameAR";
                        prmNameAR.DbType =DbType.String;
                        if (obj.NameAR == null)
                        {
                            prmNameAR.Value = DBNull.Value;
                        }
                        else
                        {
                            prmNameAR.Value = obj.NameAR;
                        }
                        strWhere += " [NameAR]=@NameAR AND ";
                        lstParameters.Add(prmNameAR);
                     }



                    

                    if (obj.NameEN != "")
                    {
                        DbParameter prmNameEN = con.createParameter();
                        prmNameEN.ParameterName = "@NameEN";
                        prmNameEN.DbType =DbType.String;
                        if (obj.NameEN == null)
                        {
                            prmNameEN.Value = DBNull.Value;
                        }
                        else
                        {
                            prmNameEN.Value = obj.NameEN;
                        }
                        strWhere += " [NameEN]=@NameEN AND ";
                        lstParameters.Add(prmNameEN);
                     }



                    

                    if (obj.MiddleNameAR != "")
                    {
                        DbParameter prmMiddleNameAR = con.createParameter();
                        prmMiddleNameAR.ParameterName = "@MiddleNameAR";
                        prmMiddleNameAR.DbType =DbType.String;
                        if (obj.MiddleNameAR == null)
                        {
                            prmMiddleNameAR.Value = DBNull.Value;
                        }
                        else
                        {
                            prmMiddleNameAR.Value = obj.MiddleNameAR;
                        }
                        strWhere += " [MiddleNameAR]=@MiddleNameAR AND ";
                        lstParameters.Add(prmMiddleNameAR);
                     }



                    

                    if (obj.MiddleNameEN != "")
                    {
                        DbParameter prmMiddleNameEN = con.createParameter();
                        prmMiddleNameEN.ParameterName = "@MiddleNameEN";
                        prmMiddleNameEN.DbType =DbType.String;
                        if (obj.MiddleNameEN == null)
                        {
                            prmMiddleNameEN.Value = DBNull.Value;
                        }
                        else
                        {
                            prmMiddleNameEN.Value = obj.MiddleNameEN;
                        }
                        strWhere += " [MiddleNameEN]=@MiddleNameEN AND ";
                        lstParameters.Add(prmMiddleNameEN);
                     }



                    

                    if (obj.LastNameAR != "")
                    {
                        DbParameter prmLastNameAR = con.createParameter();
                        prmLastNameAR.ParameterName = "@LastNameAR";
                        prmLastNameAR.DbType =DbType.String;
                        if (obj.LastNameAR == null)
                        {
                            prmLastNameAR.Value = DBNull.Value;
                        }
                        else
                        {
                            prmLastNameAR.Value = obj.LastNameAR;
                        }
                        strWhere += " [LastNameAR]=@LastNameAR AND ";
                        lstParameters.Add(prmLastNameAR);
                     }



                    

                    if (obj.LastNameEN != "")
                    {
                        DbParameter prmLastNameEN = con.createParameter();
                        prmLastNameEN.ParameterName = "@LastNameEN";
                        prmLastNameEN.DbType =DbType.String;
                        if (obj.LastNameEN == null)
                        {
                            prmLastNameEN.Value = DBNull.Value;
                        }
                        else
                        {
                            prmLastNameEN.Value = obj.LastNameEN;
                        }
                        strWhere += " [LastNameEN]=@LastNameEN AND ";
                        lstParameters.Add(prmLastNameEN);
                     }



                    

                    if (obj.Phone1 != "")
                    {
                        DbParameter prmPhone1 = con.createParameter();
                        prmPhone1.ParameterName = "@Phone1";
                        prmPhone1.DbType =DbType.String;
                        if (obj.Phone1 == null)
                        {
                            prmPhone1.Value = DBNull.Value;
                        }
                        else
                        {
                            prmPhone1.Value = obj.Phone1;
                        }
                        strWhere += " [Phone1]=@Phone1 AND ";
                        lstParameters.Add(prmPhone1);
                     }



                    

                    if (obj.Inner1 != "")
                    {
                        DbParameter prmInner1 = con.createParameter();
                        prmInner1.ParameterName = "@Inner1";
                        prmInner1.DbType =DbType.String;
                        if (obj.Inner1 == null)
                        {
                            prmInner1.Value = DBNull.Value;
                        }
                        else
                        {
                            prmInner1.Value = obj.Inner1;
                        }
                        strWhere += " [Inner1]=@Inner1 AND ";
                        lstParameters.Add(prmInner1);
                     }



                    

                    if (obj.Phone2 != "")
                    {
                        DbParameter prmPhone2 = con.createParameter();
                        prmPhone2.ParameterName = "@Phone2";
                        prmPhone2.DbType =DbType.String;
                        if (obj.Phone2 == null)
                        {
                            prmPhone2.Value = DBNull.Value;
                        }
                        else
                        {
                            prmPhone2.Value = obj.Phone2;
                        }
                        strWhere += " [Phone2]=@Phone2 AND ";
                        lstParameters.Add(prmPhone2);
                     }



                    

                    if (obj.Inner2 != "")
                    {
                        DbParameter prmInner2 = con.createParameter();
                        prmInner2.ParameterName = "@Inner2";
                        prmInner2.DbType =DbType.String;
                        if (obj.Inner2 == null)
                        {
                            prmInner2.Value = DBNull.Value;
                        }
                        else
                        {
                            prmInner2.Value = obj.Inner2;
                        }
                        strWhere += " [Inner2]=@Inner2 AND ";
                        lstParameters.Add(prmInner2);
                     }



                    

                    if (obj.Mobile1 != "")
                    {
                        DbParameter prmMobile1 = con.createParameter();
                        prmMobile1.ParameterName = "@Mobile1";
                        prmMobile1.DbType =DbType.String;
                        if (obj.Mobile1 == null)
                        {
                            prmMobile1.Value = DBNull.Value;
                        }
                        else
                        {
                            prmMobile1.Value = obj.Mobile1;
                        }
                        strWhere += " [Mobile1]=@Mobile1 AND ";
                        lstParameters.Add(prmMobile1);
                     }



                    

                    if (obj.Mobile2 != "")
                    {
                        DbParameter prmMobile2 = con.createParameter();
                        prmMobile2.ParameterName = "@Mobile2";
                        prmMobile2.DbType =DbType.String;
                        if (obj.Mobile2 == null)
                        {
                            prmMobile2.Value = DBNull.Value;
                        }
                        else
                        {
                            prmMobile2.Value = obj.Mobile2;
                        }
                        strWhere += " [Mobile2]=@Mobile2 AND ";
                        lstParameters.Add(prmMobile2);
                     }



                    

                    if (obj.Email != "")
                    {
                        DbParameter prmEmail = con.createParameter();
                        prmEmail.ParameterName = "@Email";
                        prmEmail.DbType =DbType.String;
                        if (obj.Email == null)
                        {
                            prmEmail.Value = DBNull.Value;
                        }
                        else
                        {
                            prmEmail.Value = obj.Email;
                        }
                        strWhere += " [Email]=@Email AND ";
                        lstParameters.Add(prmEmail);
                     }



                    

                    if (obj.AreaID != -1)
                    {
                        DbParameter prmAreaID = con.createParameter();
                        prmAreaID.ParameterName = "@AreaID";
                        prmAreaID.DbType =DbType.Int64;
                        if (obj.AreaID == null)
                        {
                            prmAreaID.Value = DBNull.Value;
                        }
                        else
                        {
                            prmAreaID.Value = obj.AreaID;
                        }
                        strWhere += " [AreaID]=@AreaID AND ";
                        lstParameters.Add(prmAreaID);
                     }



                    


            if (strWhere != "")
                        strWhere = " where " + strWhere.Substring(0, strWhere.LastIndexOf("AND"));

                    

            

            List<HelpDescContacts> lstRet = Select(con, "", strWhere, lstParameters.ToArray());

            return lstRet;
        }


        public List<HelpDescContacts> Search(HelpDescContacts obj)
        {
            ClassDataHandler con = new ClassDataHandler(_Connection, _Provider);

            con.OpenConnection();

            List<HelpDescContacts> lstRet = Search(con,obj);

            con.CloseConnection();

            return lstRet;
        }


                

            
public List<HelpDescContacts> SearchOrLike(ClassDataHandler con, HelpDescContacts obj)
        {
            string strWhere = "";
            List<DbParameter> lstParameters = new List<DbParameter>();

            
                    if (obj.ID != -1)
                    {
                        DbParameter prmID = con.createParameter();
                        prmID.ParameterName = "@ID";
                        prmID.DbType =DbType.Int64;
                        if (obj.ID == null)
                        {
                            prmID.Value = DBNull.Value;
                        }
                        else
                        {
                            prmID.Value = obj.ID;
                        }
                        strWhere += " [ID]=@ID OR ";
                        lstParameters.Add(prmID);
                     }



                    

                    if (obj.NameAR != "")
                    {
                        DbParameter prmNameAR = con.createParameter();
                        prmNameAR.ParameterName = "@NameAR";
                        prmNameAR.DbType =DbType.String;
                        if (obj.NameAR == null)
                        {
                            prmNameAR.Value = DBNull.Value;
                        }
                        else
                        {
                            prmNameAR.Value = obj.NameAR;
                        }
                        strWhere += " [NameAR] LIKE @NameAR OR ";
                        lstParameters.Add(prmNameAR);
                     }



                    

                    if (obj.NameEN != "")
                    {
                        DbParameter prmNameEN = con.createParameter();
                        prmNameEN.ParameterName = "@NameEN";
                        prmNameEN.DbType =DbType.String;
                        if (obj.NameEN == null)
                        {
                            prmNameEN.Value = DBNull.Value;
                        }
                        else
                        {
                            prmNameEN.Value = obj.NameEN;
                        }
                        strWhere += " [NameEN] LIKE @NameEN OR ";
                        lstParameters.Add(prmNameEN);
                     }



                    

                    if (obj.MiddleNameAR != "")
                    {
                        DbParameter prmMiddleNameAR = con.createParameter();
                        prmMiddleNameAR.ParameterName = "@MiddleNameAR";
                        prmMiddleNameAR.DbType =DbType.String;
                        if (obj.MiddleNameAR == null)
                        {
                            prmMiddleNameAR.Value = DBNull.Value;
                        }
                        else
                        {
                            prmMiddleNameAR.Value = obj.MiddleNameAR;
                        }
                        strWhere += " [MiddleNameAR] LIKE @MiddleNameAR OR ";
                        lstParameters.Add(prmMiddleNameAR);
                     }



                    

                    if (obj.MiddleNameEN != "")
                    {
                        DbParameter prmMiddleNameEN = con.createParameter();
                        prmMiddleNameEN.ParameterName = "@MiddleNameEN";
                        prmMiddleNameEN.DbType =DbType.String;
                        if (obj.MiddleNameEN == null)
                        {
                            prmMiddleNameEN.Value = DBNull.Value;
                        }
                        else
                        {
                            prmMiddleNameEN.Value = obj.MiddleNameEN;
                        }
                        strWhere += " [MiddleNameEN] LIKE @MiddleNameEN OR ";
                        lstParameters.Add(prmMiddleNameEN);
                     }



                    

                    if (obj.LastNameAR != "")
                    {
                        DbParameter prmLastNameAR = con.createParameter();
                        prmLastNameAR.ParameterName = "@LastNameAR";
                        prmLastNameAR.DbType =DbType.String;
                        if (obj.LastNameAR == null)
                        {
                            prmLastNameAR.Value = DBNull.Value;
                        }
                        else
                        {
                            prmLastNameAR.Value = obj.LastNameAR;
                        }
                        strWhere += " [LastNameAR] LIKE @LastNameAR OR ";
                        lstParameters.Add(prmLastNameAR);
                     }



                    

                    if (obj.LastNameEN != "")
                    {
                        DbParameter prmLastNameEN = con.createParameter();
                        prmLastNameEN.ParameterName = "@LastNameEN";
                        prmLastNameEN.DbType =DbType.String;
                        if (obj.LastNameEN == null)
                        {
                            prmLastNameEN.Value = DBNull.Value;
                        }
                        else
                        {
                            prmLastNameEN.Value = obj.LastNameEN;
                        }
                        strWhere += " [LastNameEN] LIKE @LastNameEN OR ";
                        lstParameters.Add(prmLastNameEN);
                     }



                    

                    if (obj.Phone1 != "")
                    {
                        DbParameter prmPhone1 = con.createParameter();
                        prmPhone1.ParameterName = "@Phone1";
                        prmPhone1.DbType =DbType.String;
                        if (obj.Phone1 == null)
                        {
                            prmPhone1.Value = DBNull.Value;
                        }
                        else
                        {
                            prmPhone1.Value = obj.Phone1;
                        }
                        strWhere += " [Phone1] LIKE @Phone1 OR ";
                        lstParameters.Add(prmPhone1);
                     }



                    

                    if (obj.Inner1 != "")
                    {
                        DbParameter prmInner1 = con.createParameter();
                        prmInner1.ParameterName = "@Inner1";
                        prmInner1.DbType =DbType.String;
                        if (obj.Inner1 == null)
                        {
                            prmInner1.Value = DBNull.Value;
                        }
                        else
                        {
                            prmInner1.Value = obj.Inner1;
                        }
                        strWhere += " [Inner1] LIKE @Inner1 OR ";
                        lstParameters.Add(prmInner1);
                     }



                    

                    if (obj.Phone2 != "")
                    {
                        DbParameter prmPhone2 = con.createParameter();
                        prmPhone2.ParameterName = "@Phone2";
                        prmPhone2.DbType =DbType.String;
                        if (obj.Phone2 == null)
                        {
                            prmPhone2.Value = DBNull.Value;
                        }
                        else
                        {
                            prmPhone2.Value = obj.Phone2;
                        }
                        strWhere += " [Phone2] LIKE @Phone2 OR ";
                        lstParameters.Add(prmPhone2);
                     }



                    

                    if (obj.Inner2 != "")
                    {
                        DbParameter prmInner2 = con.createParameter();
                        prmInner2.ParameterName = "@Inner2";
                        prmInner2.DbType =DbType.String;
                        if (obj.Inner2 == null)
                        {
                            prmInner2.Value = DBNull.Value;
                        }
                        else
                        {
                            prmInner2.Value = obj.Inner2;
                        }
                        strWhere += " [Inner2] LIKE @Inner2 OR ";
                        lstParameters.Add(prmInner2);
                     }



                    

                    if (obj.Mobile1 != "")
                    {
                        DbParameter prmMobile1 = con.createParameter();
                        prmMobile1.ParameterName = "@Mobile1";
                        prmMobile1.DbType =DbType.String;
                        if (obj.Mobile1 == null)
                        {
                            prmMobile1.Value = DBNull.Value;
                        }
                        else
                        {
                            prmMobile1.Value = obj.Mobile1;
                        }
                        strWhere += " [Mobile1] LIKE @Mobile1 OR ";
                        lstParameters.Add(prmMobile1);
                     }



                    

                    if (obj.Mobile2 != "")
                    {
                        DbParameter prmMobile2 = con.createParameter();
                        prmMobile2.ParameterName = "@Mobile2";
                        prmMobile2.DbType =DbType.String;
                        if (obj.Mobile2 == null)
                        {
                            prmMobile2.Value = DBNull.Value;
                        }
                        else
                        {
                            prmMobile2.Value = obj.Mobile2;
                        }
                        strWhere += " [Mobile2] LIKE @Mobile2 OR ";
                        lstParameters.Add(prmMobile2);
                     }



                    

                    if (obj.Email != "")
                    {
                        DbParameter prmEmail = con.createParameter();
                        prmEmail.ParameterName = "@Email";
                        prmEmail.DbType =DbType.String;
                        if (obj.Email == null)
                        {
                            prmEmail.Value = DBNull.Value;
                        }
                        else
                        {
                            prmEmail.Value = obj.Email;
                        }
                        strWhere += " [Email] LIKE @Email OR ";
                        lstParameters.Add(prmEmail);
                     }



                    

                    if (obj.AreaID != -1)
                    {
                        DbParameter prmAreaID = con.createParameter();
                        prmAreaID.ParameterName = "@AreaID";
                        prmAreaID.DbType =DbType.Int64;
                        if (obj.AreaID == null)
                        {
                            prmAreaID.Value = DBNull.Value;
                        }
                        else
                        {
                            prmAreaID.Value = obj.AreaID;
                        }
                        strWhere += " [AreaID]=@AreaID OR ";
                        lstParameters.Add(prmAreaID);
                     }



                    


            if (strWhere != "")
                        strWhere = " where " + strWhere.Substring(0, strWhere.LastIndexOf("OR"));

                    

            

            List<HelpDescContacts> lstRet = Select(con, "", strWhere, lstParameters.ToArray());

            return lstRet;
        }


        public List<HelpDescContacts> SearchOrLike(HelpDescContacts obj)
        {
            ClassDataHandler con = new ClassDataHandler(_Connection, _Provider);

            con.OpenConnection();

            List<HelpDescContacts> lstRet = SearchOrLike(con,obj);

            con.CloseConnection();

            return lstRet;
        }


                
        


       
        



    }
}











            